﻿@model List<UserVM>

@using System.Web.Mvc.Ajax
@using System.Web.Mvc.Html
@using MvcContrib.UI.Grid
@using MvcContrib.UI.Grid.ActionSyntax
@using nanoCMS.Core.WebUI.Models.ViewModels


<div class="widget">
	<div class="head"> <h5>User list </h5> </div>
	
	
	@{ Html.Grid(Model).Columns(column =>
				{
					column.For(x => x.UserID).Named("#ID");
					column.For(x=>x.Email);
					column.Custom(item => item.IsActivated ? 
											Html.Raw("Activated") : 
											Ajax.ActionLink("Activate", "ActivateUser", "UserAdmin", new {area = "Core", userID=item.UserID }, new AjaxOptions()));
					column.Custom(item=> Html.RouteLink("Edit", "UserAdminDefault", new { subaction="EditUser", userID = item.UserID } )).Named("Actions");
				}).Attributes(id => "example", @class => "display" ).Render(); }
	

</div>


<script type="text/javascript">
	jQuery(document).ready(function () {
		jQuery("#example").dataTable();

	
	  
	});

</script>